import { Injectable } from '@angular/core';

import { HEROES3 } from './mock-heroes3';
import { Logger } from '../logger.service';

@Injectable()
export class Hero3Service {
  construct(private logger: Logger,
            private isAuthorized: boolean) { }

  getHeroes3() {
    let auth = this.isAuthorized ? 'authorized' : 'unauthorized';
    this.logger.log('Getting heroes for ${auth} user.');

    return HEROES3.filter(hero => this.isAuthorized || !hero.isSecret);
  }
}
